package com.atguigu.gulimall.product.entity;

import com.atguigu.common.valid.AddValid;
import com.atguigu.common.valid.ListValue;
import com.atguigu.common.valid.UpdataValid;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;
import javax.websocket.server.PathParam;

/**
 * 品牌
 *
 * @author guolvcen
 * @email guolvcen@gmail.com
 * @date 2023-01-07 20:35:29
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@Null(message = "新增id必须为null",groups = {AddValid.class})
	@NotNull(message = "修改id不能为NULL",groups = {UpdataValid.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空")
	private String name;
	/**
	 * 品牌logo地址
	 */
	@URL(message = "必须是一个合法URL地址")
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@ListValue(vals = {1,2} ,groups = {AddValid.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty
	@Pattern(regexp = "^[a-zA-Z ]$ ",message = "首字母必须是一个字母")
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull
	@Min(value = 0,message = "排序必须大于等于0")
	private Integer sort;
}
